<template>
  <div>
    <r-search
      ref="search"
      :searchData="searchData"
      :searchForm="searchForm"
      :searchHandle="searchHandle"
      :inline="true"
    />

<!--    <div>共{{total}}条消息</div>-->

    <r-table
      :isPagination="true"
      :isHandle="true"
      :tableData="tableData"
      :tableCols="tableCols"
      :tablePage="pagination"
      :loading="tableLoading"
      :tableHandles="tableHandles"
      :isSelection="false"
      @refresh="getData()"
    />

  </div>
</template>

<script>
  export default {
    data() {
      return {
        searchData: {
          type:'',
          phone:'',
          total:'0'
        },
        searchForm: [
          { type: "select",label:'', placeholder: "提交类型", prop: "type", width: 200,options:[
              {label:'建议',value:'1'},
              {label:'投诉',value:'2'},
              {label:'其他',value:'3'}
            ] },
        ],
        searchHandle: [
          {type:'primary',label:'搜索', handle: e => this.getData(),},
          // {type:'primary',label:'重置', handle: e => this.elFormSubmit(),}
        ],

        tableLoading: false,
        tableData: [{}],
        tableCols: [
          { label: "ID", prop: "id",  },
          { label: "提交人名称", prop: "userName",  },
          { label: "提交人手机号", prop: "phone",  },
          { label: "提交类型", prop: "type",  },
          { label: "提交内容", prop: "content",  },
          { label: "提交图片", prop: "img",type:'images'  },
          { label: "提交时间", prop: "ctime",  },
        ],
        tableHandles: [

        ],
        pagination: { limit: 10, offset: 1, total: 1 },
        checkBox:[]
      };
    },
    created() {},
    mounted() {
        this.getData();
    },
    methods:{
      async getData(){
          var res=await this.apis.feedback_list({
            pageNum:this.pagination.offset,
            pageSize:this.pagination.limit,
            type:this.searchData.type
          });
          var list=res.rows||[];
          this.tableData=list;
          this.pagination.total=res.total;
      }
    }
  };
</script>

<style scoped>
</style>
